Skip to content

#1697 - Fixed Hugo depericate warning on custom params #1699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

chamiz
Copy link
Contributor

@chamiz chamiz commented Apr 27, 2024

User description

Fixed Hugo depericate warning "custom params on the language top level was deprecated in Hugo v0.112.0 and will be removed in Hugo 0.126.0"

Fix for #1697

Thanks for contributing to the Selenium site and documentation!
A PR well described will help maintainers to review and merge it quickly

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, and help reviewers by making them as simple and short as possible.

Description

After updating hugo v0.125.4 , I'm getting "custom params on the language top level was deprecated in Hugo v0.112.0 and will be removed in Hugo 0.126.0"for several translations.

Motivation and Context

So as a fix, we need to put the values as suggested.
[languages.zh-cn.params]

Source
https://gohugo.io/content-management/multilingual/#changes-in-hugo-01120

Types of changes

  • [X ] Change to the site (I have double-checked the Netlify deployment, and my changes look good)
  • Code example added (and I also added the example to all translated languages)
  • [ X] Improved translation
  • Added new translation (and I also added a notice to each document missing translation)

Checklist

  • I have read the contributing document.
  • [ X] I have used hugo to render the site/docs locally and I am sure it works.

Type

Enhancement


Description

  • Updated hugo.toml to move language-specific 'description' fields into a new 'params' sub-table for each language.
  • This modification is in response to deprecation warnings from Hugo, ensuring compatibility with future Hugo versions.
  • Affected languages include English, Portuguese (Brazilian), Simplified Chinese, Japanese, and an unspecified 'Other' language.

Changes walkthrough

Relevant files
Configuration changes
hugo.toml
Update Language Configurations to New Hugo Params Structure

website_and_docs/hugo.toml

  • Moved 'description' for each language into a new 'params' sub-table to
    adhere to Hugo's updated requirements.
  • This change affects multiple language configurations including
    English, Portuguese (Brazilian), Simplified Chinese, Japanese, and
    Other.
  • +11/-6   

    PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    Copy link

    netlify bot commented Apr 27, 2024

    Deploy Preview for selenium-dev failed.

    Name Link
    🔨 Latest commit 872f442
    🔍 Latest deploy log https://app.netlify.com/sites/selenium-dev/deploys/6632f1ee44432f0008fef03f

    @CLAassistant
    Copy link

    CLAassistant commented Apr 27, 2024

    CLA assistant check
    All committers have signed the CLA.

    @qodo-merge-pro qodo-merge-pro bot added the enhancement New feature or request label Apr 27, 2024
    Copy link
    Contributor

    PR Description updated to latest commit (7807853)

    Copy link
    Contributor

    PR Review

    ⏱️ Estimated effort to review [1-5]

    2, because the changes are straightforward and limited to configuration adjustments in a TOML file. The PR modifies the structure to comply with newer Hugo standards, which is a simple, yet important update.

    🧪 Relevant tests

    No

    🔍 Possible issues

    No

    🔒 Security concerns

    No


    ✨ Review tool usage guide:

    Overview:
    The review tool scans the PR code changes, and generates a PR review which includes several types of feedbacks, such as possible PR issues, security threats and relevant test in the PR. More feedbacks can be added by configuring the tool.

    The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.

    • When commenting, to edit configurations related to the review tool (pr_reviewer section), use the following template:
    /review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...
    
    [pr_reviewer]
    some_config1=...
    some_config2=...
    

    See the review usage page for a comprehensive guide on using this tool.

    Copy link
    Contributor

    PR Code Suggestions

    CategorySuggestions                                                                                                                                                       
    Maintainability
    Improve formatting consistency in key-value assignments.

    Ensure consistency in spacing around the equals sign for key-value pairs in the TOML file.
    This improves readability and maintainability.

    website_and_docs/hugo.toml [56]

    -languageName ="English"
    +languageName = "English"
     
    Remove unused commented code.

    Remove the commented-out line for module replacements if it is not intended for use, to
    keep the configuration clean and maintainable.

    website_and_docs/hugo.toml [89]

    -#replacements = "github.com/google/docsy -> ../../docsy"
    +# This line has been removed to keep the configuration clean.
     
    Enhancement
    Reduce redundancy by using a loop for identical values across multiple sections.

    Consider using a loop or a more dynamic configuration method if the descriptions for
    different languages are identical, to reduce redundancy and improve maintainability.

    website_and_docs/hugo.toml [59-83]

    -description = "Selenium automates browsers. That's it!"
    +# Assuming a hypothetical template or loop mechanism in TOML or the consuming application:
    +# for each language in languages:
    +#   language.params.description = "Selenium automates browsers. That's it!"
     

    ✨ Improve tool usage guide:

    Overview:
    The improve tool scans the PR code changes, and automatically generates suggestions for improving the PR code. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on a PR.

    • When commenting, to edit configurations related to the improve tool (pr_code_suggestions section), use the following template:
    /improve --pr_code_suggestions.some_config1=... --pr_code_suggestions.some_config2=...
    
    [pr_code_suggestions]
    some_config1=...
    some_config2=...
    

    See the improve usage page for a comprehensive guide on using this tool.

    Copy link
    Member

    @diemol diemol left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    @chamiz
    Copy link
    Contributor Author

    chamiz commented Apr 29, 2024

    Thanks for reviewing. I will do those changes as well.

    @chamiz chamiz force-pushed the #1697-Hugo-depericate-warning-custom-params-on-the-language-top-level branch 2 times, most recently from cb981c7 to a1d8247 Compare April 29, 2024 23:15
    @chamiz
    Copy link
    Contributor Author

    chamiz commented Apr 29, 2024

    @diemol Ready to merge.

    @diemol
    Copy link
    Member

    diemol commented Apr 30, 2024

    It seems the build is now failing.

    …niumHQ#1699
    
    Fixed deprecated params.
    Updated Hugo and Docsy versions
    @chamiz chamiz force-pushed the #1697-Hugo-depericate-warning-custom-params-on-the-language-top-level branch from 06e680b to 16f7fbe Compare May 1, 2024 00:00
    @chamiz
    Copy link
    Contributor Author

    chamiz commented May 1, 2024

    yes. "no such template "_internal/google_analytics_async.html" Error.
    It was deprecated. They already changed the Docsy repo but haven't released the version with the fix yet.

    Also my bad, I forgot that I made that change locally. :)

    Until they make the release I will set the Hugo version to 0.124.1.

    image

    chamiz added 3 commits May 1, 2024 02:03
    Updated Hugo to 0.125.4
    Updated Docsy to 0.10.0
    …n-the-language-top-level' of https://github.com/chamiz/seleniumhq.github.io into SeleniumHQ#1697-Hugo-depericate-warning-custom-params-on-the-language-top-level
    @chamiz
    Copy link
    Contributor Author

    chamiz commented May 2, 2024

    google/docsy#1985 (comment)

    Docsy maintainers team bumped the version to 0.10.0 which has fix for "no such template "_internal/google_analytics_async.html" Error.

    @diemol
    Copy link
    Member

    diemol commented May 2, 2024

    The branch name you have #1697-Hugo-depericate-warning-custom-params-on-the-language-top-level is erroring the deploy script. I guess we did not consider to escape especial characters.

    Could you change the branch name so we can see the deployment, please?

    @chamiz chamiz closed this May 2, 2024
    @chamiz chamiz deleted the #1697-Hugo-depericate-warning-custom-params-on-the-language-top-level branch May 2, 2024 09:40
    @chamiz
    Copy link
    Contributor Author

    chamiz commented May 2, 2024

    Hi @diemol ,
    Created a new PR with the renamed branch.
    #1702

    I closed this one

    diemol pushed a commit that referenced this pull request May 2, 2024
    * #1697 - Fixed Hugo depericate warning on custom params #1699
    
    Fixed deprecated params.
    Updated Hugo and Docsy versions
    
    * Updated Hugo version and Docsy versions
    
    Updated Hugo to 0.125.4
    Updated Docsy to 0.10.0
    
    [deploy site]
    selenium-ci added a commit that referenced this pull request May 2, 2024
    * #1697 - Fixed Hugo depericate warning on custom params #1699
    
    Fixed deprecated params.
    Updated Hugo and Docsy versions
    
    * Updated Hugo version and Docsy versions
    
    Updated Hugo to 0.125.4
    Updated Docsy to 0.10.0
    
    [deploy site] 26aa5a4
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    3 participants